using System;
using System.Collections;
using System.Collections.Generic;

namespace System.Data
{
	public class EnumerableRowCollection<TRow> : EnumerableRowCollection, IEnumerable<TRow>
	{
		IEnumerable<TRow> source;

		internal EnumerableRowCollection (IEnumerable<TRow> source)
		{
			this.source = source;
		}

		public IEnumerator<TRow> GetEnumerator ()
		{
			foreach (TRow row in source)
				yield return row;
		}

		IEnumerator IEnumerable.GetEnumerator ()
		{
			return GetEnumerator ();
		}
	}
}
